<template>
  <div>
    <p>商品列表</p>
    <ul>
      <li v-for="(item, index) in goodsList" :key="index">
        <router-link :to="'/detail/'+item.name">{{item.name}}</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      goodsList: [
        { name: "iphone", num: 5, price: 5999 },
        { name: "huawei", num: 15, price: 6999 },
        { name: "xiaomi", num: 10, price: 5899 },
        { name: "vivo", num: 12, price: 4599 },
      ],
    }
  },
}
</script>

<style>

</style>